package com.summer.data.jql.concept.func;

import com.summer.data.Jsql;
import com.summer.data.dialect.Dialect;
import com.summer.data.jql.Context;
import com.summer.data.jql.concept.Field;
import com.summer.data.table.BaseColumn;

/**
 * 小写转换函数
 * 
 * @author 345480567@qq.com
 */
public class Lower implements Field<String> {

    private final BaseColumn column;

    public Lower(BaseColumn column) {
        this.column = column;
    }

    @Override
    public Jsql toFieldSql(Context ctx, Dialect dialect) {
        return Jsql.format("LOWER(%s)", column.toFieldSql(ctx, dialect));
    }
}
